package org.wheel.plugins.toolkit.fieldrole;

import java.util.List;

import org.springframework.beans.factory.SmartInitializingSingleton;
import org.wheel.plugins.toolkit.sql.spi.FieldRoleSpi;

/**
 * 刷新阶段再初始化一次，收集用户自定义 SPI
 */
public class FieldRoleRegistryBean implements SmartInitializingSingleton {

    private final List<FieldRoleSpi> spiList;

    public FieldRoleRegistryBean(List<FieldRoleSpi> spiList) {
        this.spiList = spiList;
    }

    @Override
    public void afterSingletonsInstantiated() {
        FieldRoleRegistryInitializer.init(spiList);
    }
}